package com.example.Observer;

public class AppTest {

	public static void main(String[] args) {
		WeatherData subject = new WeatherData();
		
		DisplayA displayA = new DisplayA();
		subject.register(displayA);
		subject.register(new DisplayB());
		subject.setParams(1); // 发生变更，触发通知: A、B
		
		subject.remove(displayA);
		subject.remove(null);
		subject.remove(displayA);
		subject.setParams(1); // 发生变更，触发通知: B
		// output:
		// 	DisplayA changed
		// 	DisplayB changed
		// 	DisplayB changed
	}

}
